<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script src="../jQuery/jquery-1.11.2.js"></script>
    <script src="../code/highstock.js"></script>
    <script src="../code/modules/exporting.js"></script>
   <!-- <script src="../code/code/highcharts-plugins/highcharts-zh_CN.js"></script>
-->    <script src="../code/modules/drag-panes.js"></script>
    <script src="../code/themes/dark-unica.js"></script>
    <link rel="stylesheet" href="../layui/css/layui.css"/>
    <script src="../jQuery/jquery-1.11.2.js"></script>
    <script src="../layui/layui.js"></script>
    <style>
        #test img{
            width: 100%;
            height: 600px;
        }
        #explain{
            font-size: 40px;
            font-family: "微软雅黑";
            margin-left: 120px;
        }
        #explain img{
            width: 1100px;
            height: 510px;
        }
        #container{

            color: white;
        }
    </style>
    <link rel="stylesheet" type="text/css" href="/css/font.css">
    <style>::-webkit-scrollbar{display: none;}</style>
</head>
<body>
<div id="container" style="min-width:600px;height:770px;"></div>
<script>
    Highcharts.setOptions({
        lang: {
            rangeSelectorZoom: ''
        }
    });
    $.getJSON('/code/ssk.json', function (data) {
        if(data.code !== 1) {
            alert('读取股票数据失败！');
            return false;
        }
        data = data.data;
        var ohlc = [],
            volume = [],
            dataLength = data.length,
            // set the allowed units for data grouping
            groupingUnits = [[
                'week',                         // unit name
                [1]                             // allowed multiples
            ], [
                'month',
                [1, 2, 3, 4, 6]
            ]],
            i = 0;
        for (i; i < dataLength; i += 1) {
            ohlc.push([
                data[i][0], // the date
                data[i][1], // open
                data[i][2], // high
                data[i][3], // low
                data[i][4] // close
            ]);
            volume.push([
                data[i][0], // the date
                data[i][5] // the volume
            ]);
        }
        // create the chart
        var chart = Highcharts.stockChart('container', {
            rangeSelector: {
                selected: 1,
                inputDateFormat: '%Y-%m-%d'
            },
            title: {
                text: '平安银行历史股价'
            },
            chart:{
                backgroundColor: '#fff'
            },
            xAxis: {
                dateTimeLabelFormats: {
                    millisecond: '%H:%M:%S.%L',
                    second: '%H:%M:%S',
                    minute: '%H:%M',
                    hour: '%H:%M',
                    day: '%m-%d',
                    week: '%m-%d',
                    month: '%y-%m',
                    year: '%Y'
                }
            },
            tooltip: {
                split: false,
                shared: true,
            },
            yAxis: [{
                labels: {
                    align: 'right',
                    x: -3
                },
                title: {
                    text: '股价'
                },
                height: '65%',
                resize: {
                    enabled: true
                },
                lineWidth: 2
            }, {
                labels: {
                    align: 'right',
                    x: -3
                },
                title: {
                    text: '成交量'
                },
                top: '65%',
                height: '35%',
                offset: 0,
                lineWidth: 2
            }],
            series: [{
                type: 'candlestick',
                name: '平安银行',
                color: 'green',
                lineColor: 'green',
                upColor: 'red',
                upLineColor: 'red',
                tooltip: {
                },
                navigatorOptions: {
                    color: Highcharts.getOptions().colors[0]
                },
                data: ohlc,
                dataGrouping: {
                    units: groupingUnits
                },
                id: 'sz'
            },{
                type: 'column',
                data: volume,
                yAxis: 1,
                dataGrouping: {
                    units: groupingUnits
                }
            }]
        });
    });
   /* Highcharts.setOptions({
        lang: {
            rangeSelectorZoom: ''
        }
    });
    $.getJSON('/code/ssk.json', function (data) {
        if(data.code !== 1) {
            alert('读取股票数据失败！');
            return false;
        }
        data = data.data;
        var ohlc = [],
            volume = [],
            dataLength = data.length,
            // set the allowed units for data grouping
            groupingUnits = [[
                'week',                         // unit name
                [1]                             // allowed multiples
            ], [
                'month',
                [1, 2, 3, 4, 6]
            ]],
            i = 0;
        for (i; i < dataLength; i += 1) {
           var kkj=data[i][0]+365*1000*60*60*24*3;
            //alert(new Dae(ktkj).toString());
            ohlc.push([
                kkj, // the date
                data[i][1], // open
                data[i][2], // high
                data[i][3], // low
                data[i][4] // close
            ]);
            volume.push([
                kkj, // the date
                data[i][5] // the volume
            ]);
        }
        // create the chart
        var chart = Highcharts.stockChart('container', {
            rangeSelector: {
                selected: 5,
                inputDateFormat: '%Y-%m-%d'
            },
            title: {
                text: ''
            },
            xAxis: {
                dateTimeLabelFormats: {
                    millisecond: '%H:%M:%S.%L',
                    second: '%H:%M:%S',
                    minute: '%H:%M',
                    hour: '%H:%M',
                    day: '%m-%d',
                    week: '%m-%d',
                    month: '%y-%m',
                    year: '%Y'
                }
            },
            tooltip: {
                split: false,
                shared: true,
            },
            yAxis: [{
                labels: {
                    align: 'right',
                    x: -3
                },
                title: {
                    text: '股价'
                },
                height: '65%',
                resize: {
                    enabled: true
                },
                lineWidth: 2
            }, {
                labels: {
                    align: 'right',
                    x: -3
                },
                title: {
                    text: '成交量'
                },
                top: '65%',
                height: '35%',
                offset: 0,
                lineWidth: 2
            }],
            series: [{
                type: 'candlestick',
                name: '深股',
                color: 'green',
                lineColor: 'green',
                upColor: 'red',
                upLineColor: 'red',
                tooltip: {
                },
                navigatorOptions: {
                    color: Highcharts.getOptions().colors[0]
                },
                data: ohlc,
                dataGrouping: {
                    units: groupingUnits
                },
                id: 'sz'
            },{
                type: 'column',
                data: volume,
                yAxis: 1,
                dataGrouping: {
                    units: groupingUnits
                }
            }]
        });
    });*/
</script>
<div class="layui-carousel" id="test" style="overflow-y:visible;overflow-x:visible;">
    <div carousel-item>
        <div><img src="../image/ten.jpg"></div>
        <div><img src="../image/nine.jpg"></div>
        <div><img src="../image/one.jpg"></div>
        <div><img src="../image/six.jpg"></div>
    </div>
</div>
<!--功能说明图-->
<!--<div style="margin-top: 50px">
    <img src="../image/five.jpg" style="float: left;width: 750px;">
    <img src="../image/seven.jpg" style="width: 750px">
</div>-->
<div id="explain" style="overflow-y:visible;overflow-x:visible;">
    <span>安全可靠</span>
    <hr style="width: 1100px;margin-left: 20px"/>
    <img src="../image/eight.jpg"><br/>
    <span>功能强大</span>
    <hr style="width: 1100px;margin-left: 20px"/>
    <img src="../image/two.jpg"><br/>
    <span>友好易用</span>
    <hr style="width: 1100px;margin-left: 20px"/>
    <img src="../image/three.jpg"><br/>
    <span>科技智能</span>
    <hr style="width: 1100px;margin-left: 20px"/>
    <img src="../image/four.jpg">

</div>
<script>
    layui.use('carousel', function(){
        var carousel = layui.carousel;
        //建造实例
        carousel.render({
            elem: '#test'
            ,height:'600px'
            ,width: '100%' //设置容器宽度
            ,arrow: 'always' //始终显示箭头
            ,interval:'3000'//下一条公告时间为5秒
        });
    });
</script>

</body>
</html>